<?php
$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'网站配置'=>array($this->pre_module_url.'/setting/webconfig'),
	'屏蔽词管理'=>array($this->pre_module_url.'/words/admin'),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('words-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<!-- 搜索框 -->
<div class="search-form" >
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div>
<!-- 列表 -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'words-grid',
	'artLink'=>array(
			array('批量删除','delete',"确认删除选中项！"),
	),
	'selectAll'=>array('ids[]','id[]'),
	'batchItem'=>array(
			//移动到分类
			CHtml::linkbtn('增加屏蔽词',array($this->pre_module_url.'/words/create')),
	),
	'dataProvider'=>$model->search(),//数据源
//	'filter'=>$model,//设置过滤器，筛选输入框
	'columns'=>array(
		array(
			'class' => 'CCheckBoxColumn',
			'selectableRows' => 2,
			//'footer' => '<button type="button" onclick="GetCheckbox(\'selectbox\',\$this->pre_module_url.'/words/delete\');" style="width:76px">批量删除</button>',
			//'footerHtmlOptions'=> array('colspan'=>'5'),
			'htmlOptions' => array('width'=>'6%','class'=>'t_c','onclick'=>'CheckList("ids[]","id[]")'),
			//'checkBoxHtmlOptions' => array('name' => 'selectbox[]'),
		),
		array('name'=>'zw_id',
				'value'=>'$data->zw_id',
				'htmlOptions'=>array('width'=>'7%','class'=>'t_c'),
		),
		array('name'=>'zw_title',
			  'value'=>'$data->zw_title',
			  'htmlOptions'=>array('width'=>'25%'),
		),
		array('name'=>'zw_level',
			'value'=>'Words::model()->getLevel($data->zw_level)',//数据转换
			'htmlOptions'=>array('width'=>'7%','class'=>'t_c'),
		),
		array('name'=>'zw_replaceword',
			'value'=>'$data->zw_replaceword',
			'htmlOptions'=>array('width'=>'18%'),
		),
		array('name'=>'zw_listorder',
			'value'=>'$data->zw_listorder',
			'htmlOptions'=>array('width'=>'10%','class'=>'t_c'),
		),
		array('name'=>'inputtime',
			'value'=>'date("Y-m-d",$data->inputtime)',//格式化日期
			'htmlOptions'=>array('width'=>'13%'),
		),
		array(
			'class'=>'CButtonColumn',
			'header'=>'操作',
			'htmlOptions'=>array('width'=>'15%'),
			'buttons'=>array('view'=>array(    
								'visible'=>'false'//查看按钮设为不可见
							)
			)
		)
	)
));
?>
